import swaggerAutogen from "swagger-autogen";

const doc = {
    info: {
        title: "Van-Fullstack-Service",
        description: "Van-Fullstack-Service 接口文档",
    },
    host: "localhost:8003",
    basePath: "",
    components: {
        securitySchemes: {
            bearerAuth: {
                type: "http",
                scheme: "bearer",
            },
        },
    },
};

const outputFile = "./apidoc.json";
const routes = [
    "./src/controllers/admin/dictionary.ts",
    "./src/controllers/admin/file.ts",
    "./src/controllers/admin/auth.ts",
    "./src/controllers/admin/codeGenerate.ts",
    "./src/controllers/admin/user.ts",
    "./src/controllers/admin/role.ts",
    "./src/controllers/admin/permission.ts",
];

/* NOTE: If you are using the express Router, you must pass in the 'routes' only the 
root file where the route starts, such as index.js, app.js, routes.js, etc ... */

// eslint-disable-next-line @typescript-eslint/no-floating-promises
swaggerAutogen({ openapi: "3.0.0", autoQuery: false })(outputFile, routes, doc);
